package com.example.java250929_xmlaop;

import com.example.java250929_xmlaop.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class AopTest {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-aop.xml");
        UserService userService = context.getBean("userService", UserService.class);

        // 正常执行
        userService.addUser();

        // 模拟异常（需在目标方法中抛出异常）
        // userService.deleteUser();
    }
}
